/** 合并对象 */
export function deepMerge<T = any>(src: any = {}, target: any = {}): T {
  let key: string
  for (key in target) {
    src[key] =
      typeof src[key] === 'object' ? deepMerge(src[key], target[key]) : (src[key] = target[key])
  }
  return src
}

export function cloneDeep<T = any>(val: T): T {
  return deepMerge({}, val)
}
